<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <didi-component></didi-component>
    </div>
    <script type="text/javascript" src="../../../../commonJS/vue.js"></script>
    <script type="text/javascript" src="../../../../commonJS/zepto-1.2.0.js"></script>
    <!-- <script type="text/javascript" src="../../../../commonJS/moment.js"></script> -->
    <!-- <script type="text/javascript" src="../../../../commonJS/common.js"></script> -->
    <script>
        //【1】组件选项中的el和data与vue构造器选项中这两个属性的赋值会稍微有些不同，
        //（1）在组件选项中，el是没有的【目前我看到的是这样】
        //（2）data在构造器中是直接赋值，而在组件中，data是函数，且以return对象的形式声明数据
        //【1-1】构造器的写法
        var app = new Vue({
            el: "#app",
            data: {
                name: "name"
            }
        });
        //【1-2】组件的写法
        var MyComponent = Vue.extend({
            data: function() {
                return {
                    name: "component"
                }
            }
        })
    </script>
</body>